import request from '@/utils/request'

// 查询顾客列表
export function listCustomer(query) {
  return request({
    url: '/work/shopcustomer/list',
    method: 'get',
    params: query
  })
}

// 查询顾客详细
export function getCustomer(id) {
  return request({
    url: '/work/shopcustomer/' + id,
    method: 'get'
  })
}

// 新增顾客
export function addCustomer(data) {
  return request({
    url: '/work/shopcustomer/saveOrUpdate',
    method: 'post',
    data: data
  })
}

// 修改顾客
export function updateCustomer(data) {
  return request({
    url: '/work/shopcustomer/saveOrUpdate',
    method: 'post',
    data: data
  })
}

// 删除顾客
export function delCustomer(id) {
  return request({
    url: '/work/shopcustomer/delete-by-id',
    method: 'get',
    params: { id: id }
  })
}


export function delCustomers(ids) {
  return request({
    url: '/work/shopcustomer/delete-by-ids',
    method: 'get',
    params: { ids: ids }
  })
}
// 分配店员
export function bindClerk(clerkId, customerId) {
  return request({
    url: '/work/shopcustomer/bindClerk',
    method: 'get',
    params: { clerkId: clerkId, customerId: customerId }
  })
}

//分配店员dic
export function getDic() {
  return request({
    url: '/work/shopclerk/availableClerkDic',
    method: 'get'
  })
}


